/**
 * Created by Henry on 15/6/21.
 */
Ext.define('Admin.model.User', {
    extend: 'Ext.data.Model',

    fields: [{
        name: 'name',
        type: 'string'
    }, {
        name: 'sex',
        type: 'boolean'
    }, {
        name: 'age',
        type: 'integer'
    }, {
        name: 'birthday',
        type: 'date',
        convert: function (value, record) {
            if (Ext.isDate(value)) {
                return value;
            } else if (Ext.isString(value)) {
                return Ext.Date.parse(value, 'Y-m-d');
            }
        }
    }]
});